﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using MongoDB.Driver;

namespace IFTRUE.DataAdapter.MongoDB
{
    /// <summary>
    /// 作用：MongoDB适配器
    /// 作者：iftrue
    /// 日期：2013-05-21
    /// </summary>
    public class MongoDBAdapter
    {
        /// <summary>
        /// 获取数据库连接
        /// </summary>
        /// <returns></returns>
        public static MongoDatabase GetDatabase(string conn, string databaseName)
        {
            var mc = new MongoClient(conn);
            var ms = mc.GetServer();
            var database = ms.GetDatabase(databaseName);
            return database;
        }
    }
}